package com.aurora.base.util;

import java.io.File;
import java.io.IOException;

import org.springframework.web.multipart.MultipartFile;

public class UploadFileUtil{

	public static String upload(MultipartFile file,String path) throws IOException {
		File filePath=new File(path);
		if (!filePath.exists()) {
			filePath.mkdirs();
		}
		File file2=new File(path+File.separator+ToPinYinUtil.converterToSpell(file.getOriginalFilename()));
		
		file.transferTo(file2);
		return file2.getPath();
	}
	
}
